package il.ac.tau.cvws.scrabblesidekick.server.engine.recoginition;

import il.ac.tau.cvws.scrabblesidekick.shared.datatype.game.Recognizable;
import il.ac.tau.cvws.scrabblesidekick.shared.datatype.game.Tile;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import com.googlecode.javacv.cpp.opencv_core.IplImage;

/* Maps a tile to its image. This map is created during the calibration.
 */
public class TileImageMap implements Recognizable, Iterable<Map.Entry<Tile, IplImage>>
{
	private final Map<Tile, IplImage> tileImageMap;
	
	public TileImageMap()
	{
		this.tileImageMap = new HashMap<Tile, IplImage>();
	}
	
	public void put(Tile tile, IplImage image)
	{
		tileImageMap.put(tile, image);
	}
	
	@Override
	public Iterator<Map.Entry<Tile, IplImage>> iterator()
	{
		return tileImageMap.entrySet().iterator();
	}
}
